/*
 * @Description:
 * @Version: 1.0
 * @Autor: ziwei
 * @Date: 2021-06-25 20:14:44
 * @LastEditors: ziwei
 * @LastEditTime: 2021-06-25 21:27:34
 */
const path = require("path");
const HtmlWebpackPlugin = require('html-webpack-plugin')
module.exports = {
  mode: "development",
  devtool: 'source-map',
  entry: "./src/index.js",
  output: {
    path: path.resolve("dist"),
    filename: "main.js",
  },
  resolveLoader:{//设置如何找loader
    alias:{'babel-loader':path.resolve('./loaders/babel-loader.js')}
  },
  module: {
    rules: [
      {
        test: /.js/,
        use: [
          {
            loader: "babel-loader",
            options: {
              presets: ["@babel/preset-env"],
            },
          },
        ],
      },
    ],
  },
  plugins:[
    new HtmlWebpackPlugin({
      template:'./src/index.html'
    })
  ]
};
